package com.gylang.mail.controller;

import com.gylang.common.model.mail.TemplateMailBean;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * @author gylang,
 * @data 2019/11/25 19:51,
 * @DESC
 */
@Controller
@RequestMapping("web")
public class WebController {

    @RequestMapping("/resetPassword")
    public ModelAndView resetPasswrd(@Valid TemplateMailBean templateMailBean, BindingResult bindingResult) {
        if (bindingResult.hasErrors()) {
            bindingResult.getAllErrors().iterator();

        }
        ModelAndView mail = new ModelAndView("emailTemplate");
        mail.addObject("username","1006718977");
        mail.addObject("code",131543);
        mail.addObject("deleteEmail","https://gylang.xyz");

        return mail;
    }
}
